package com.xioyi.news.dao.impl;

import java.io.Serializable;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.springframework.transaction.annotation.Transactional;

import com.xioyi.news.dao.IBaseDAO;

@Transactional
public class IBaseDAOImpl<T, ID extends Serializable> implements IBaseDAO<T, ID> {
	private EntityManager em;
	@Override
	public T findObject(Integer objectId) throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void saveOrUpdateObject(T t) throws SQLException {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void saveObject(T t) throws SQLException {
		em.persist(t);
	}

	@Override
	public void updateObject(T t) throws SQLException {
		// TODO Auto-generated method stub
		
	}

	@Override
	public T getObject(String objectId) throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public T loadObject(ID objectId) throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public T findByObjectId(String objectId) throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<T> findAll(String querySql) throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void deleteObject(T t) throws SQLException {
		// TODO Auto-generated method stub
		
	}

	@Override
	public List<T> findObject(String querySql) throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<T> findObject(String querySql, Object value)
			throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<T> findObject(String querySql, Object[] values)
			throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<T> findObjectByLimit(Map<String, String> condition,
			int firstResult, int maxResult) throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<T> findObjectByLimit(Map<String, String> condition,
			int firstResult, int maxResult, Map<String, String> orderByMap)
			throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	/**
	 * @return the em
	 */
	public EntityManager getEm() {
		return em;
	}

	/**
	 * @param em the em to set
	 */
	@PersistenceContext
	public void setEm(EntityManager em) {
		this.em = em;
	}
	
}
